<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<%
request.setCharacterEncoding("utf-8");
String user = (String) session.getAttribute("user");
String message = request.getParameter("message");
if(message!=null){
	StringBuffer sbmes = (StringBuffer) application.getAttribute("messages");
	if (sbmes == null)
		sbmes = new StringBuffer();
	sbmes.append(user + "说：" + message + "<br>");
	application.setAttribute("messages", sbmes);	
}
%>
<meta charset="UTF-8">
<title>Insert title here</title>
</head>
<body>
	<form action="" method="post">
		消息<input name="message" size="100" /> <input value="发送" type="submit">
	</form>
</body>
</html>